#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>

#include<algorithm>
using namespace std;
class Solution {
public:
    int MoreThanHalfNum_Solution(vector<int> numbers)
    {
        int res = 0;
        sort(numbers.begin(), numbers.end());
        int mid = numbers.size() / 2;
        res = numbers[mid];
        int count = 0;
        for (int i = 0; i < numbers.size(); i++)
        {
            if (numbers[i] == res)
                count++;
        }
        if (count >= mid)
            return res;
        else
            return -1;
    }
};
int main()
{

    return 0;
}